package com.bw.module_service.adapter

import com.bw.module_service.R
import com.bw.module_service.model.InspectionModelItem
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class InspectionAdapter: BaseQuickAdapter<InspectionModelItem, BaseViewHolder>(R.layout.item_inspection_layout) {
    override fun convert(holder: BaseViewHolder, item: InspectionModelItem) {
        holder.setText(R.id.tv_Project_Name,item.projectId)
        holder.setText(R.id.tv_name,item.pointName)
        holder.setText(R.id.tv_type,item.patrolType)
        holder.setText(R.id.tv_position,item.pointLocation)
        holder.setText(R.id.tv_state,item.patrolStandard)

        if (item.patrolType.equals("安防巡检")){
            holder.setBackgroundResource(R.id.tv_type,R.drawable.shape_orange)
        }else if (item.patrolType.equals("家居巡检")){
            holder.setBackgroundResource(R.id.tv_type,R.drawable.shape_blue)
        }else{
            holder.setBackgroundResource(R.id.tv_type,R.drawable.shape_green)
        }
    }
}